<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //1.当做普通函数被调用
    //使用call apply bind
    //作为对象方法调用
    //在class的方法中调用
    //箭头函数
  </script>
  <script src="./bind.js"></script>
  <script>
    function createCache(){
      const data={}
      return {
        set:function(key,val){
          data[key]=val
        },
        get:function(key){
          return data[key]
        }
      }
    }
    const c=createCache()
    c.set('a',100)
    console.log(c.get('a'));
  </script>
</body>
</html>